﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WorkList
{
    public partial class DayForm : Form
    {
        int HEIGHT = 100, FONT_SIZE = 25;
        public DayForm(List<lessonMarker> lessons)
        {
            InitializeComponent();
            createLessonsLabels(lessons);
        }

        void createLessonsLabels(List<lessonMarker> lessons)
        {
            int lesCount = 0;
            foreach (var lesson in lessons)
            {
                Label info = new Label();
                info.AutoSize = true;
                info.Text = $"{lesson.Time, -8}{lesson.Name, -10}{lesson.Discipline}";
                info.Location = new Point(0, HEIGHT * lesCount);
                info.Font = new Font("Times new Roman", FONT_SIZE);
                info.ForeColor = Color.FromArgb(230, 230, 230);
                this.LessonsPanel.Controls.Add(info);
                lesCount++;
            }
        }
    }
}
